<template>
    <div>子组件内容：{{ $props.msg }}</div>
    <button @click="onFatherEvent">触发父组件</button>
</template>
<script lang="ts" setup>
    import { onMounted } from 'vue'

    const $props = defineProps({
        msg: {
            type: String,
            default: '出事默认值',
        },
    })

    const $state = {
        name: '熊爱明',
    }
    const $eimt = defineEmits(['onChang'])
    const onFatherEvent = () => {
        $eimt('onChang', '触发父组件')
    }
    defineExpose({
        $state,
    })
</script>
